import pymysql
import redis


class DB_interface:
    def exploit_db(self):
        kf_con = pymysql.connect(host='112.125.25.114', port=3306, user="python",
                                 password="pythonselect", database="mykhadmin")
        return kf_con

    def online_db(self):
        online_db = pymysql.connect(host="121.4.69.146", user='root', password='xhhg@2020', port=3306, db="big_data",
                                    use_unicode=True, charset='utf8')
        return online_db

    def online_redis(self):
        online_redis = redis.Redis(host="121.4.69.146", password='xhhg123456', port=6389, db=2, decode_responses=True)
        return online_redis
